<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script type="text/javascript">
		var n1=prompt("请输入数字");
		n1=Number(n1);
		var bai=parseInt(n1/100);
		var shi=parseInt(n1%100/10);
		var ge=n1%10;
		// alert("百位数"+bai+"十位数"+shi+"个位数"+ge);
		alert(bai+shi+ge);
		
		

	</script>
</head>
<body>
	
</body>
</html>